import request from '@/utils/request'

export function getCustomer(did) {
  return request({
    url: '/customer/get',
    params: {
      'id': did
    },
    method: 'get'
  })
}
export function getBal() {
  return request({
    url: '/custbal/get',
    method: 'get'
  })
}
export function listCustomer(pos, size, conditions) {
  return request({
    url: '/customer/list',
    params: {
      'jsonCondition': JSON.stringify(conditions),
      'pos': pos,
      'size': size
    },
    method: 'get'
  })
}
export function delCustomer(customermodel) {
  return request({
    url: '/customer/del',
    data: customermodel,
    method: 'post'
  })
}
export function delCustomers(jsonCustomerModel) {
  return request({
    url: '/customer/bulkdel',
    data: {
      data: jsonCustomerModel
    },
    method: 'post'
  })
}
export function setCustomer(customermodel) {
  return request({
    url: '/customer/set',
    data: customermodel,
    method: 'post'
  })
}
export function listByRetail(retail, name) {
  return request({
    url: '/customer/listbyretail',
    params: {
      'retail': retail,
      'customername': name
    },
    method: 'get'
  })
}
